<template>
  <div class="home_container">
    <vue-particles
      color="#dedede"
      :particleOpacity="0.7"
      :particlesNumber="80"
      shapeType="star"
      :particleSize="4"
      linesColor="#FFFFFF"
      :linesWidth="2"
      :lineLinked="true"
      :lineOpacity="0.4"
      :linesDistance="150"
      :moveSpeed="3"
      :hoverEffect="true"
      hoverMode="grab"
      :clickEffect="true"
      clickMode="push"
      class="cash"
    >
    </vue-particles>
    <el-container>
      <!-- 首部 -->
      <BaseHeader :activeIndex="activeIndex"></BaseHeader>
      <!-- <MainOne class="me-container"></MainOne> -->
      <router-view class="me-container" />
      <GoTop />
      <BaseFooter v-show="footerShow" />
    </el-container>
    <!-- <div></div> -->

    <!-- 主体部分一 -->
    <!-- <div class="me-container"></div>
    <div></div> -->
  </div>
</template>

<script>
import MainOne from "./components/MainOne.vue";
import BaseFooter from "./components/BaseFooter.vue";
import BaseHeader from "./components/BaseHeader.vue";
import GoTop from "./components/GoTop.vue";
export default {
  name: "Home",
  components: { MainOne, BaseFooter, BaseHeader, GoTop },
  data() {
    return {
      activeIndex: "/",
      footerShow: false,
    };
  },
  beforeRouteEnter(to, from, next) {
    next((vm) => {
      if (to.path === "/noticeInfo/1") {
      vm.activeIndex = "/noticeInfo";
    } else if (to.path === "/basicData/0") {
      vm.activeIndex = "/basicData";
    } else {
      vm.activeIndex = to.path;
    }
    });
  },
  beforeRouteUpdate(to, from, next) {
    if (to.path == "/main-one") {
      this.footerShow = true;
    } else {
      this.footerShow = false;
    }
    if (to.path === "/noticeInfo/1") {
      this.activeIndex = "/noticeInfo";
    } else if (to.path === "/basicData/0") {
      this.activeIndex = "/basicData";
    } else {
      this.activeIndex = to.path;
    }
    next();
  },
};
</script>

<style>
.home_container {
  background-image: linear-gradient(to right, #ebbba7 0%, #cfc7f8 100%);
  font-weight: 400;
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  line-height: 1.5;
  min-height: 100%;
}
.cash {
  position: fixed;
  top: 0;
  width: 100%;
}
/* a {
  cursor: pointer;
  text-decoration: none;
  transition: none 86ms ease-out;
}
a:hover {
  color: #5fb878;
} */
/* .me-area {
  background-color: #fff;
} */
/* html {
  height: 100%;
}
body {
  min-height: 100%;
} */
/* body {
  position: relative;
} */
.me-container {
  margin: 80px auto 140px;
}
.me-pull-right {
  float: right;
}
</style>